package com.iflytek.hive.need8;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

public class MaxGoodsGroupingComparator extends WritableComparator {
    protected MaxGoodsGroupingComparator(){
        super(GoodsAmountBean.class,true);
    }

    @Override
    public int compare(WritableComparable a, WritableComparable b) {
        GoodsAmountBean aBean = (GoodsAmountBean) a;
        GoodsAmountBean bBean = (GoodsAmountBean) b;
        String first = aBean.getDate();
        String secound = bBean.getDate();
        return first.compareTo(secound);
    }
}
